<template>
    <view class="gjl-view">
        <view class="main">
            <view class="main-list">
                <view class="list-li" @click="$routerTo({path:'/pagesMine/copartner/rich-text',query:{type:2,id:item.planId}})" v-for="(item,index) in list" :key="index">
                    <view class="top-img">
                        <image :src="item.planImg" mode=""></image>
                    </view>
                    <view class="title cl1">
                        {{item.planTitle}}
                    </view>
                    <view class="time">
                        {{item.planAddTime | formatTime('yyyy-MM-dd hh:mm:ss')}}
                    </view>
                </view>
            </view>
        </view>
    </view>
</template>

<script>
    import $utils from '@/util/index.js'
    import service from "@/service"
    export default {
        filters:{
            formatTime(value){
                return $utils.dateFmt( Number(value+'000'), 'yyyy-MM-dd hh:mm:ss')
            },
        },
        data(){
            return {
                list: [],
                listQuery: {
                    page: 1,
                    limit: 10
                }
            }
        },
        mounted() {
            this.getList()
        },
        onReachBottom(){
            this.getList();
        },
        methods:{
            // 获取列表
            getList(){
                service.mineService.palns({
                    data: { ...this.listQuery
                    },
                    success: res => {
                        let list = res.result.data;
                        if (this.listQuery.page == 1) {
                            this.list = list;
                        } else {
                            this.list = this.list.concat(list);
                        }
                        if(list.length > 0){
                            this.listQuery.page++;
                        }
                    },
                    fail: () => {
                
                    },
                    complete: () => {
                        uni.hideLoading();
                    },
                });
            }
        }
    }
</script>

<style scoped lang="scss">
    .gjl-view{
        min-height: 100%;
        overflow: hidden;
        background:rgba(249,249,249,1);
        .main{
            margin: 40rpx 30rpx 0;
            .main-list{
                .list-li + .list-li{
                    margin-top: 30rpx;
                }
                .list-li{
                    padding-bottom: 22rpx;
                    background:rgba(255,255,255,1);
                    border-radius: 10rpx;
                    .top-img{
                        background:rgba(221,221,221,1);
                        height: 330rpx;
                        width: 100%;
                        image{
                            height: 100%;
                            width: 100%;
                            background:rgba(221,221,221,1);
                        }
                    }
                    .title{
                        margin-left: 20rpx;
                        margin-top: 20rpx;
                        font-size:28rpx;
                        font-weight:400;
                        color:rgba(51,51,51,1);
                    }
                    .time{
                        margin-left: 20rpx;
                        margin-top: 15rpx;
                        font-size:24rpx;
                        font-weight:400;
                        color:rgba(153,153,153,1);
                    }
                }
            }
        }
    }
</style>